﻿using LayeredSkin.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using Top_Meeting.UI;
using Top_Meeting.Window;
using TopVisionVideoStream;

namespace Top_Meeting.Window
{
    public partial class Frm_Startup : Frm_Base
    {
        public static Frm_Startup instance = null;

        public Frm_Startup()
        {
            if (instance == null)
            {
                instance = this;
            }
            else if (instance != this)
            {
                Close();
                return;
            }


            var ret = TVVS.Init(this);
            if (!ret)
            {
                MessageBox.Show("Core Init Failed", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            Configuration.Init();
            TMUI.Init();
            TMFont.Init();

            InitializeComponent();

            FrmInit();
        }

        #region OVERRIDE

        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            TVVS.Dispose();
        }

        protected override void InitEvent()
        {
            base.InitEvent();

            layBtn_Frm_Login_Open.Click += LayBtn_Frm_Login_Open_Click;

            Debug.WriteLine("InitEvent");
        }

        protected override void UpdateLayout()
        {
            base.UpdateLayout();

            Debug.WriteLine("UpdateLayout");
        }

        #endregion


        #region CONTROL_EVENT

        private void LayBtn_Frm_Login_Open_Click(object sender, EventArgs e)
        {
            Helper.ShowWindow<Frm_Login>();
            Hide();
        }

        #endregion


        #region PUBLIC_METHOD



        #endregion
    }
}
